package com.grablist.feihu.grablist.ui.fragment.biz;

import com.grablist.feihu.grablist.base.BaseBean;
import com.grablist.feihu.grablist.base.BaseBiz;
import com.grablist.feihu.grablist.base.BaseResp;
import com.grablist.feihu.grablist.bean.ClueInfo;
import com.grablist.feihu.grablist.comm.BaseSubscribe2;
import com.grablist.feihu.grablist.comm.RetrofitHelp;

import java.util.List;

import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

public class GrabHallBiz extends BaseBiz {

    /**
     * 获取线索列表图
     *
     * @param callback
     */
    public void getClueList(String userCode, Integer pageNum, Integer pagesize,String trainingType, String  businessCircle,
                            final BaseBiz.Callback<BaseBean<List<ClueInfo>>> callback) {
        com.add(RetrofitHelp.getSecretApi().userList(userCode, pageNum, pagesize,trainingType, businessCircle)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseSubscribe2<BaseResp<BaseBean<List<ClueInfo>>>>() {

                    @Override
                    public void onSuccess(Object obj) {
                        callback.onSuccess((BaseBean<List<ClueInfo>>) obj);
                    }

                    @Override
                    public void onFailure(Object obj) {
                        callback.onFailure((BaseBean<List<ClueInfo>>) obj);
                    }
                })
        );
    }

}
